<template>
  <div class="add-node-btn-box">
    <div class="add-node-btn">
      <el-popover
        v-model="visible"
        placement="right-start"
        popper-class="add-node-popover"
      >
        <div class="add-node-popover-body">
          <div class="add-node-popover-item approver" @click="addType()">
            <div class="item-wrapper">
              <img
                src="../../assets/images/approver.png"
                alt=""
                class="img-style"
              >
            </div>
            <p>审批人</p>
          </div>
        </div>
        <button slot="reference" class="btn" type="button">
          <i style="color: #fff" class="el-icon-plus" />
        </button>
      </el-popover>
    </div>
  </div>
</template>
<script>
class AppUser {
  utype = 1; // 1 = 固定审批人 2 = 直属上级
  attr = 1; //	1 = 或签 2 = 会签
  nodeName = '申请人自选';
  user = [
  ];
}
export default {
  props: ['childNodeP', 'nodeConfig', 'tip'],
  data() {
    return {
      visible: false,
      parentObj: {},
      appUser: new AppUser()
    };
  },
  methods: {
    addType() {
      this.visible = false;
      this.$emit('childNodeP', this.appUser);
    }
  }
};
</script>
<style lang="scss" >
.add-node-btn-box {
  width: 240px;
  display: inline-flex;
  flex-shrink: 0;
  position: relative;
  margin: 0 auto;
  // &:first-child {
  //   // margin-left: 16px;
  // }
  &:before {
    content: "";
    position: absolute;
    top: 1px;
    left: 0px;
    right: 0;
    bottom: 0;
    z-index: -1;
    margin: auto;
    width: 1px;
    // height: 100%;
    background-color: #ebebeb;
  }
}
.img-style {
  width: 36px;
}
.add-node-popover {
  padding: 14px 26px;
  .add-node-popover-body {
    display: flex;
    .add-node-popover-item {
      margin-right: 20px;
      text-align: center;
      cursor: pointer;
      &:last-child {
        margin-right: 0;
      }
      i {
        font-size: 36px;
      }
      p {
        color: #333;
        margin-top: 4px;
      }
    }
    .approver {
      i {
        color: #e6a23c;
      }
    }
    .condition {
      i {
        color: #67c23a;
      }
    }
    .notifier {
      i {
        color: #4880ff;
      }
    }
  }
}
</style>
